package com.sc.VenusQueryBeta.model.account;

import com.hengjun.kingstar.sdk.base.BaseModel;

import com.hengjun.kingstar.sdk.helper.RetrofitCreateHelper;
import com.hengjun.kingstar.sdk.helper.RxHelper;
import com.sc.VenusQueryBeta.api.Host;
import com.sc.VenusQueryBeta.api.account.AccountApi;
import com.sc.VenusQueryBeta.contract.account.xiugai.XiuGaiContract;

import io.reactivex.Observable;


/**
 * Created by SC-02 on 2018/9/19.
 * 修改model 继承Basemodel 并且实现契约累的model方法
 */

public class XiuGaiModel extends BaseModel implements XiuGaiContract.IXiuGaiModel {


    /**
     * 实例化对象
     */
    public static XiuGaiModel newInstance(){
        return new XiuGaiModel();
    }

    @Override
    public Observable<String> userchangepwd(int clientindex, String oldPassword, String newPassword, String serverAddress, String projectName, int serverPort) {

        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").userchangepwd(clientindex,
                oldPassword,newPassword).compose(RxHelper.<String>rxSchedulerHelper());
    }
}

